﻿using UnityEngine;
using System.Collections;

public class MinimapBg : MonoBehaviour {

    public static MinimapBg _instance; //单例

    public Transform playerIcon;

    public GameObject EnemyIconPrefabs;

    void Awake()
    {
        _instance = this;
        playerIcon = transform.Find("Container");
    }

	// Use this for initialization
	void Start () {
	}
	
	// Update is called once per frame
	void Update () {
	
	}
    // 实时更新图标信息
    public Transform GetPlayerIcon()
    {
        return playerIcon;
    }

    // 获取BOSS的图标
    public GameObject GetBossIcon()
    {
       GameObject go =  NGUITools.AddChild(this.gameObject, EnemyIconPrefabs);
       go.GetComponent<UISprite>().spriteName = "BossIcon"; // 给当前游戏对象添加图标
       return go;
    }

    // 获取Monst的图标
    public GameObject GetMonstIcon()
    {
        GameObject go = NGUITools.AddChild(this. gameObject, EnemyIconPrefabs);
        go.GetComponent<UISprite>().spriteName = "EnemyIcon";
        return go;
    }

}
